Skip to content

Increase e2e coverage for NewPICredit and Prepayment processors#308

Open
marcoagonzales007 wants to merge 3 commits into
CCI-MOC:mainfrom
marcoagonzales007:add-e2e-coverage
Open

Increase e2e coverage for NewPICredit and Prepayment processors#308
marcoagonzales007 wants to merge 3 commits into
CCI-MOC:mainfrom
marcoagonzales007:add-e2e-coverage

Conversation

@marcoagonzales007

@marcoagonzales007 marcoagonzales007 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Part of #185

Updates the e2e test data so the full pipeline covers previously-uncovered branches in the two processors

NewPICreditProcessor (80% -> 90%)

  • Changed pi1@bu.edu to a "first invoice month" of 2025-06 (age 0) and pi2@harvard.edu to 2025-05 (age 1) in test_PI.csv
  • This makes both PIs credit eligible within the age window, so the credit-application logic now is able to run

PrepaymentProcessor (82% -> 87%)

  • Added a dedicated PI (pi7@mit.edu) and project (P7) whose balance survives the subsidy processors, so the prepayment step applies the discount
  • Pointed TestGroup1's prepay project at P7 and extended its end date to 2025-12 so it's active for the invoice month
  • This covers the active prepay project logic and the debit-recording path that were never reached before

@QuanMPhm QuanMPhm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment

pi4@example.edu,2025-06,0.00,0.00,0.00
pi1@bu.edu,2025-04,1000.00,300.00,0.00
pi2@harvard.edu,2025-04,1000.00,300.00,0.00
pi1@bu.edu,2025-06,1000.00,320.00,0.00

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on your PR description and the changes you made, it seems that since the e2e test will now actually apply the New-PI credit and prepayments to some invoices, mutable test files (test_PI.csv and test_prepay_debits.py) will now be changed after each run of the e2e test. Could you edit the code in test_e2e_pipeline.py so that the aforementioned files are not changed after each run? My suggestion comes from the idea that what we commit into the repo should only be the test cases, not their results or side effects. Investigate the ways you can accomplish this, and let me know what solution you'll like to implement.

Also, I'm curious why I don't see changes to test_prepay_debits.py in this PR diff. Was it not changed when you ran the e2e test on your machine?

@marcoagonzales007 marcoagonzales007 Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your feedback, and I think It was changed by the pipeline itself during the run. I reverted it thinking it was a stray change, but I now realize that's the side effect of the problem you have just described. I'll work on test_e2e_pipeline.py so that the files are not changed after each run. my plan for this is to copy the mutable files into the temp workspace and point the pipeline at these copies, so the test data stays untouched. Let me know if that sounds good. Thank you.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll work on test_e2e_pipeline.py so that the files are not changed after each run. my plan for this is to copy the mutable files into the temp workspace and point the pipeline at these copies,

Nice! That was the solution I had in mind too. Let me know when you've amended this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants